DOORS crash loading all views?

I am getting an unusual DOORS crash: the reported error does not list the source file, so I assume this is not in my script!?

-R-E- DXL: <Line:186> null Module parameter was passed into argument position 2
Backtrace:
        <Line:324>

 

Any idea to figure out how to debug such an error.

 

FWIW - the code is a re-used generic routine that opens (visible) a bunch of user-chosen modules and runs some code - below is the only real customization, the routine that does the module processing.

It loads every view in the module looking for layout DXL code having a line matching a certain pattern, which it will report on.

bool processModule(Module m)
{
        bool returnStatus=true //the function return value; will be set to false if the processing of the module is deemed unsuccessful. 
    int badColumns=0 //count of columns across all module views with layout DXL including a reference to a bad (repository) include file.
    string viewName
    Column c
    string ldxl,currentLdxlLine,columnTitle
    int columnNumber
    Regexp line=regexp2 ".*"
    Regexp repoMatch=regexp2 "^[ \t]*#include[ \t]+.*TCDS_SCRIPTS_REPOSITORY"
    

        //PROCESS MODULE: 
        //---------------
        for viewName in views(m) do
        {
        if (!load(m,view(getItem m,viewName),false)) 
        {
            returnStatus=false //couldn't load all views
                resultMsg+=formatRTF__T(RTF_RED__T,"WARNING: Could not load view \"" viewName "\"!\n")
        }
        else
        {
            columnNumber=0
            for c in m do
            {
                columnNumber++
                ldxl=dxl(c)
                if (! null ldxl)
                {
                    while (!null ldxl && line ldxl)
                    {
                        currentLdxlLine=ldxl[match 0]
                        if (repoMatch currentLdxlLine) 
                        {
                            columnTitle=title(c)
                            badColumns++
                                resultMsg+="...offending layout DXL in view \"" viewName "\" column " columnNumber " (column title \"" columnTitle "\")!\n"
                        }
                        ldxl = ldxl[2 + end 0:] //move past newline //better formulation than...  ldxl = ldxl[end 0 + 2:] (per Mathias M)
                    } 
                }
            }
        }
        }
    if (badColumns>0)
    {
        badColumnsTTL=badColumnsTTL+badColumns
            resultMsg+="Detected a total of " badColumns " offending layout DXL columns across all module views in this module (as detailed above)!\n"
    }
    else
    {
            resultMsg+="Detected NO offending layout DXL columns in this module.\n"
    }
    
        //RETURN PROCESSING STATUS:
        return(returnStatus)
}//end: bool processModule(Module m)

 


strathglass - Wed Jan 24 14:08:29 EST 2018

Re: DOORS crash loading all views?
strathglass - Wed Jan 24 14:11:51 EST 2018

Sorry - formatting was off in original post...hopefully this is better:

bool processModule(Module m)
{
    bool returnStatus=true //the function return value; will be set to false if the processing of the module is deemed unsuccessful. 
    int badColumns=0 //count of columns across all module views with layout DXL including a reference to a bad (repository) include file.
    string viewName
    Column c
    string ldxl,currentLdxlLine,columnTitle
    int columnNumber
    Regexp line=regexp2 ".*"
    Regexp repoMatch=regexp2 "^[ \t]*#include[ \t]+.*TCDS_SCRIPTS_REPOSITORY"
    

    //PROCESS MODULE: 
    //---------------
    for viewName in views(m) do
    {
        if (!load(m,view(getItem m,viewName),false)) 
        {
            returnStatus=false //couldn't load all views
            resultMsg+=formatRTF__T(RTF_RED__T,"WARNING: Could not load view \"" viewName "\"!\n")
        }
        else
        {
            columnNumber=0
            for c in m do
            {
                columnNumber++
                ldxl=dxl(c)
                if (! null ldxl)
                {
                    while (!null ldxl && line ldxl)
                    {
                        currentLdxlLine=ldxl[match 0]
                        if (repoMatch currentLdxlLine) 
                        {
                            columnTitle=title(c)
                            badColumns++
                            resultMsg+="...offending layout DXL in view \"" viewName "\" column " columnNumber " (column title \"" columnTitle "\")!\n"
                        }
                        ldxl = ldxl[2 + end 0:] //move past newline //better formulation than...  ldxl = ldxl[end 0 + 2:] (per Mathias M)
                    } 
                }
            }
        }
    }
    if (badColumns>0)
    {
        badColumnsTTL=badColumnsTTL+badColumns
        resultMsg+="Detected a total of " badColumns " offending layout DXL columns across all module views in this module (as detailed above)!\n"
    }
    else
    {
        resultMsg+="Detected NO offending layout DXL columns in this module.\n"
    }
    
    //RETURN PROCESSING STATUS:
    return(returnStatus)
}//end: bool processModule(Module m)

 

Re: DOORS crash loading all views?
Mike.Scharnow - Wed Jan 24 16:47:47 EST 2018

strathglass - Wed Jan 24 14:11:51 EST 2018

Sorry - formatting was off in original post...hopefully this is better:

bool processModule(Module m)
{
    bool returnStatus=true //the function return value; will be set to false if the processing of the module is deemed unsuccessful. 
    int badColumns=0 //count of columns across all module views with layout DXL including a reference to a bad (repository) include file.
    string viewName
    Column c
    string ldxl,currentLdxlLine,columnTitle
    int columnNumber
    Regexp line=regexp2 ".*"
    Regexp repoMatch=regexp2 "^[ \t]*#include[ \t]+.*TCDS_SCRIPTS_REPOSITORY"
    

    //PROCESS MODULE: 
    //---------------
    for viewName in views(m) do
    {
        if (!load(m,view(getItem m,viewName),false)) 
        {
            returnStatus=false //couldn't load all views
            resultMsg+=formatRTF__T(RTF_RED__T,"WARNING: Could not load view \"" viewName "\"!\n")
        }
        else
        {
            columnNumber=0
            for c in m do
            {
                columnNumber++
                ldxl=dxl(c)
                if (! null ldxl)
                {
                    while (!null ldxl && line ldxl)
                    {
                        currentLdxlLine=ldxl[match 0]
                        if (repoMatch currentLdxlLine) 
                        {
                            columnTitle=title(c)
                            badColumns++
                            resultMsg+="...offending layout DXL in view \"" viewName "\" column " columnNumber " (column title \"" columnTitle "\")!\n"
                        }
                        ldxl = ldxl[2 + end 0:] //move past newline //better formulation than...  ldxl = ldxl[end 0 + 2:] (per Mathias M)
                    } 
                }
            }
        }
    }
    if (badColumns>0)
    {
        badColumnsTTL=badColumnsTTL+badColumns
        resultMsg+="Detected a total of " badColumns " offending layout DXL columns across all module views in this module (as detailed above)!\n"
    }
    else
    {
        resultMsg+="Detected NO offending layout DXL columns in this module.\n"
    }
    
    //RETURN PROCESSING STATUS:
    return(returnStatus)
}//end: bool processModule(Module m)

 

your script is way too short for such line numbers. 
most likely one of your views contains a DXL Layout column with DXL code that tries to open a module which does not exist any more - this code is probably written badly, without checks.

Re: DOORS crash loading all views?
Mike.Scharnow - Wed Jan 24 16:53:58 EST 2018

for debugging, you should print the module name and view name that you are trying to open before you load the view. 

And I'm not sure if this really helps, but it might help if you enclose your view load command with noError() and lastError()

Re: DOORS crash loading all views?
PekkaMakinen - Thu Jan 25 02:36:34 EST 2018

Do you use triggers? Try to start your DOORS client with -T switch (as database manager) to turn of all triggers.

Check module for bad layout DXL, see SmartDXL http://www.smartdxl.com/content/?p=426

Re: DOORS crash loading all views?
strathglass - Thu Jan 25 06:48:31 EST 2018

Thanks Pekka and Mike. Based on your input, I will try to use noError/lastError...although I am not sure that will help. I had already tried to print and even log to file the view names...that had not yet helped isolate the issue.

Interesting that the Tony Goodman code needlessly tries to clear user and global default views when there is an option to load() to do that! (Maybe he wrote that before such an option existed?)

 

I know from the error message that the issue the other user is seeing (which I am trying to find) is a permissions issue: that user does not have access to a repository location where the layout DXL is looking for an include file.

The problem is after he experienced it again yesterday I checked the view and NONE of the columns had any reference to include files.

Also odd is that the error only occurred when he executed a search! 

Very strange behaviour there!

Re: DOORS crash loading all views?
Mike.Scharnow - Thu Jan 25 08:14:11 EST 2018

strathglass - Thu Jan 25 06:48:31 EST 2018

Thanks Pekka and Mike. Based on your input, I will try to use noError/lastError...although I am not sure that will help. I had already tried to print and even log to file the view names...that had not yet helped isolate the issue.

Interesting that the Tony Goodman code needlessly tries to clear user and global default views when there is an option to load() to do that! (Maybe he wrote that before such an option existed?)

 

I know from the error message that the issue the other user is seeing (which I am trying to find) is a permissions issue: that user does not have access to a repository location where the layout DXL is looking for an include file.

The problem is after he experienced it again yesterday I checked the view and NONE of the columns had any reference to include files.

Also odd is that the error only occurred when he executed a search! 

Very strange behaviour there!

clearing the default views before opening the module has the advantage that you can at least "read" the module without any error (Standard View is loaded). But with later versions of DXL, the 3rd parameter in "Module read(string name [,bool disp[, bool loadStandardView]])" has been introduced which does the same.

Hm, my guess is that the error occurs after a search because somewhere in the middle of the module, there is a link to another module, your layout code tries to get some attribute from the linked module, but this module cannot be opened e.g. because of whatever access rights are missing or because the linked module has a default view that executes code which goes berserk. So, the view of the module the user works in itself is OK, but not the linked module. If this is the case, open the module of the user in standard view and iterate over all objects, collecting the linked modules. Then try to open these modules and hopefully "bang!"...